package com.keon.jianbao.util;

import android.graphics.Bitmap;

import com.keon.jianbao.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;

/**
 * Created by keon on 15/10/18.
 */
public class UILUtils {
    //头像，圆角
    public static DisplayImageOptions getOptions1() {

        return new DisplayImageOptions.Builder()
                .showImageForEmptyUri(R.mipmap.icon)
                .showImageOnFail(R.mipmap.icon)
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .build();
    }

    public static DisplayImageOptions getOptions2() {

        return new DisplayImageOptions.Builder()
                .imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
                .showImageForEmptyUri(R.mipmap.loading)
                .showImageOnFail(R.mipmap.pagefailed_bg)
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .build();
    }

    public static DisplayImageOptions getOptions3() {

        return new DisplayImageOptions.Builder()
                .imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
                .showImageForEmptyUri(R.mipmap.loading)
                .showImageOnFail(R.mipmap.pagefailed_bg)
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .build();
    }
}
